package ${content.controller.classPackage};

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;

import ${content.service.classPackage}.${content.service.className};
import ${content.entity.classPackage}.${content.entity.className};

/**
 * ${content.entity.className}的路由接口服务
 *
 * @author
 *
 */
@RestController
@RequestMapping("/${content.entity.className}")
public class ${content.controller.className} {

	/** ${content.entity.className}Service服务 */
	@Autowired
	private I${content.service.className} ${content.service.className?uncap_first};



    @GetMapping("/getById")
    public ${content.entity.className} getById(String id){
       LambdaQueryWrapper<${content.entity.className}> lambda=new QueryWrapper<${content.entity.className}>().lambda();
       lambda.eq(${content.entity.className}::getId,id);
       ${content.entity.className} one = ${content.service.className?uncap_first}.getOne(lambda);
       return one;
	}


    @PostMapping("/save")
    public ${content.entity.className} save(@RequestBody ${content.entity.className} entity){
     boolean save = ${content.service.className?uncap_first}.save(entity);
     return tUser;

    }

    @PostMapping("/list")
    public List<TUser> list( ){
        List<${content.entity.className}> list = ${content.service.className?uncap_first}.list();
        return list;
    }

    @PostMapping("/deleteByIds")
    public boolean deleteByIds(List<String> ids ){
            boolean b = ${content.service.className?uncap_first}.removeByIds(ids);
            return b;
     }

}
